import { Button, Modal, Text } from "@nextui-org/react";

export default function DeleteConfirmation(props) {
  return (
    <Modal
      closeButton
      aria-labelledby="删除确认"
      open={props.deleteDialogVisiable}
      onClose={() => props.setDeleteDialogVisiable(false)}
    >
      <Modal.Header>
        <Text id="modal-title" size={18}>
          <Text b size={18}>
            是否确认删除？
          </Text>
        </Text>
      </Modal.Header>
      <Modal.Body>{props.children}</Modal.Body>
      <Modal.Footer>
        <Button auto flat onClick={() => props.setDeleteDialogVisiable(false)}>
          取消
        </Button>
        <Button
          auto
          color="error"
          onClick={() => {
            props.setDeleteDialogVisiable(false);
            props.callback(true);
          }}
        >
          确认
        </Button>
      </Modal.Footer>
    </Modal>
  );
}
